package kr.hkit.powerjava.chapter7.G;

import java.util.Scanner;

public class 반복1c {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int b = 0;
		System.out.println("정수 갯수를 입력하시오.");
				
		for(;;){
			
			System.out.println("정수를 입력하시오.");
			int num = input.nextInt();
			b = b + num;
			if(num==0)
			break;
		}
	System.out.println(b);
	}

}